package com.yaoming.umengshare;

import android.util.Log;

import com.umeng.socialize.PlatformConfig;
import com.umeng.socialize.common.SocializeConstants;

/**
 * Created by zwj on 2016/1/11.
 */
public class UmShareConfig {
    private static int BACKGROUND_COLOR=-1;
    private static int TEXT_COLOR=-1;
    private static float TEXT_SIZE=-1;
    private static int NUMCOLUMNS=-1;
    private static float IMAGE_SCALE=-1;
    private static boolean changBgColor=false;
    private static boolean changeTextColor=false;
    private static boolean changeTextSize=false;
    private static boolean changeNumColumns=false;
    private static  boolean changeImageScale=false;
    public static void setAppKey(String key){
        SocializeConstants.APPKEY=key;
    }

    public static void setWeixin(String appId,String appSecret){
        PlatformConfig.setWeixin(appId, appSecret);
    }
    public static void setSinaWeibo(String appId,String appSecret,String redirectUrl){
        PlatformConfig.setSinaWeibo(appId, appSecret,redirectUrl);
    }
    public static void setQQZone(String appId,String appSecret){
        PlatformConfig.setQQZone(appId, appSecret);
    }
//    public static void setTencentWeibo(String appId,String appSecret){
//        PlatformConfig.setTencentWeibo(appId, appSecret);
//    }

    public static void setBackgroundColor(int color){
       changBgColor=true;
        BACKGROUND_COLOR=color;
    }
    public static void setTextColor(int color){
        changeTextColor=true;
        TEXT_COLOR=color;
    }
    public static int getBackgroundColor(){
        return BACKGROUND_COLOR;
    }
    public static int getTextColor(){
        return TEXT_COLOR;
    }
    public static  boolean isChangBgColor(){
        return  changBgColor;
    }
    public static  boolean isChangeTextColor(){
        return changeTextColor;
    }
    public static void setTextSize(float size){
        changeTextSize=true;
        TEXT_SIZE=size;
    }
    public static float getTextSize(){
        return TEXT_SIZE;
    }
    public static boolean isChangeTextSize(){
        return  changeTextSize;
    }
    public static void setNumColumns(int colums){
        changeNumColumns=true;
        NUMCOLUMNS=colums;
    }
    public  static int getNumColumns(){
        return NUMCOLUMNS;
    }
    public static boolean isChangeNumColumns(){
        return changeNumColumns;
    }

    /**
     * 设置每格内图标所占比例
     * @param scale 大于0小于等于1
     */
    public static void setImageScale(float scale){
        if ((scale<=1)&&(scale>0)){
            changeImageScale=true;
            IMAGE_SCALE=scale;
        }
    }
    public static float getImageScale(){
        return IMAGE_SCALE;
    }
    public static boolean isChangeImageScale(){
        return changeImageScale;
    }
}
